<div id="app">
  组件内子组件只能在该组件内使用
  <component-a></component-a>
  <!-- component-b 只能在component-a内使用 -->
  <!-- <component-b></component-b> -->
</div>
<script src="https://unpkg.com/vue@next"></script>
<script>

  const ComponentB = {
    template: `<div>ComponentB</div>`
  }
  const ComponentA = {
    components: {
      // 'component-b': ComponentB,
      ComponentB
    },
    template: `
      <div>ComponentA</div>
      <component-b></component-b>
    `
  }

  Vue.createApp({
    components: { 
      ComponentA
    }
  }).mount('#app')
</script>